// pages/splitsale_sale/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    list:[],
    id:"",
    make:""
  },

  /**
   * 生命周期函数--监听页面加载 // 四参数详解  分销员ID  分销人所在店铺ID  商品id或店铺ID   如果0是商品如果为1是店铺
   */
  onLoad: function (options) {
    console.log(options);
     this.setData({
      list : options,
      id:options.id,
      make:options.make//判断是店铺还是商品
     })
  },
  onShareAppMessage: function () {
    console.log(this.data.make);
    if(this.data.make == 1){ //店铺推广
      return {
        title: '送自己与闺蜜花之盛宴',
        path: '/pages/register/index?scene=' + wx.getStorageSync("user_id")+","+ wx.getStorageSync("store_id")+","+wx.getStorageSync("store_id")+",1",
        imageUrl: 'https://img01.yzcdn.cn/upload_files/2021/05/03/Fi6DGCCc5i5Y2x3eeZxY2wQlWUEp.png'
      }
    }else{//商品推广
      return {
        title: '送自己与闺蜜花之盛宴',
        path: '/pages/register/index?scene=' + wx.getStorageSync("user_id")+","+ wx.getStorageSync("store_id")+","+this.data.id+",0",
        imageUrl: 'https://img01.yzcdn.cn/upload_files/2021/05/03/Fi6DGCCc5i5Y2x3eeZxY2wQlWUEp.png'
      }
    }
    
  }
})